package com.tboss.template.home.service;

import java.security.Principal;
import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;

import org.springframework.stereotype.Service;
import org.springframework.ui.Model;

@Service
public class HomeService {
	
	//private static final Logger logger = LoggerFactory.getLogger(TopMenuService.class);

	public void home(Locale locale, String sysCode, Model model, Principal principal){
		Date date = new Date();
		DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
		
		String formattedDate = dateFormat.format(date);		
		model.addAttribute("serverTime", formattedDate );
		//if(principal != null) logger.info(principal.getName());
	}
	
}
